using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class AdditivePreservativeAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public AdditivePreservativeAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v24] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v25] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v251] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v26] = HL7TableType.HL7;
						tableVersionTypes[HL7Version.v27] = HL7TableType.HL7;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v24] = new string[]{"EDTK","EDTN","HEPL","HEPN","C32","C38","BOR","HCL6"};
						validVersionCodes[HL7Version.v25] = new string[]{"F10","C32","C38","HCL6","ACDA","ACDB","ACET","AMIES","HEPA","BACTM","BOR","BOUIN","BF10","WEST","BSKM","CARS","CARY","CHLTM","CTAD","ENT","ENT+","JKM","KARN","LIA","HEPL","M4","M4RT","M5","MICHTM","MMDTM","HNO3","NONE","PAGE","PHENOL","KOX","EDTK","EDTK15","EDTK75","PVA","RLM","SST","SILICA","NAF","FL100","FL10","NAPS","HEPN","EDTN","SPS","STUTM","THROM","FDP","THYMOL","THYO","TOLU","URETM","VIRTM"};
						validVersionCodes[HL7Version.v251] = new string[]{"F10","C32","C38","HCL6","ACDA","ACDB","ACET","AMIES","HEPA","BACTM","BOR","BOUIN","BF10","WEST","BSKM","CARS","CARY","CHLTM","CTAD","ENT","ENT+","JKM","KARN","LIA","HEPL","M4","M4RT","M5","MICHTM","MMDTM","HNO3","NONE","PAGE","PHENOL","KOX","EDTK","EDTK15","EDTK75","PVA","RLM","SST","SILICA","NAF","FL100","FL10","NAPS","HEPN","EDTN","SPS","STUTM","THROM","FDP","THYMOL","THYO","TOLU","URETM","VIRTM"};
						validVersionCodes[HL7Version.v26] = new string[]{"F10","C32","C38","HCL6","ACDA","ACDB","ACET","AMIES","HEPA","BACTM","BOR","BOUIN","BF10","WEST","BSKM","CARS","CARY","CHLTM","CTAD","ENT","ENT+","JKM","KARN","LIA","HEPL","M4","M4RT","M5","MICHTM","MMDTM","HNO3","NONE","PAGE","PHENOL","KOX","EDTK","EDTK15","EDTK75","PVA","RLM","SST","SILICA","NAF","FL100","FL10","NAPS","HEPN","EDTN","SPS","STUTM","THROM","FDP","THYMOL","THYO","TOLU","URETM","VIRTM"};
						validVersionCodes[HL7Version.v27] = new string[]{"F10","C32","C38","HCL6","ACDA","ACDB","ACET","AMIES","HEPA","BACTM","BOR","BOUIN","BF10","WEST","BSKM","CARS","CARY","CHLTM","CTAD","ENT","ENT+","JKM","KARN","LIA","HEPL","M4","M4RT","M5","MICHTM","MMDTM","HNO3","NONE","PAGE","PHENOL","KOX","EDTK","EDTK15","EDTK75","PVA","RLM","SST","SILICA","NAF","FL100","FL10","NAPS","HEPN","EDTN","SPS","STUTM","THROM","FDP","THYMOL","THYO","TOLU","URETM","VIRTM"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v24] = new string[]{"Potassium/K EDTA","Sodium/Na EDTA","Lithium/Li  Heparin","Sodium/Na  Heparin","3.2%  Citrate","3.8% Citrate","Borate","6N HCL"};
						validVersionDescriptions[HL7Version.v25] = new string[]{"10% Formalin","3.2%  Citrate","3.8% Citrate","6N HCL","ACD Solution A","ACD Solution B","Acetic Acid","Amies transport medium","Ammonium heparin","Bacterial Transport medium","Borate Boric Acid","Bouin's solution","Buffered 10% formalin","Buffered Citrate (Westergren Sedimentation Rate)","Buffered skim milk","Carson's Modified 10% formalin","Cary Blair Medium","Chlamydia transport medium","CTAD (this should be spelled out if not universally understood)","Enteric bacteria transport medium","Enteric plus","Jones Kendrick Medium","Karnovsky's fixative","Lithium iodoacetate","Lithium/Li  Heparin","M4","M4-RT","M5","Michel's transport medium","MMD transport medium","Nitric Acid","None","Pages's Saline","Phenol","Potassium Oxalate","Potassium/K EDTA","Potassium/K EDTA 15%","Potassium/K EDTA 7.5%","PVA (polyvinylalcohol)","Reagan Lowe Medium","Serum Separator Tube (Polymer Gel)","Siliceous earth, 12 mg","Sodium Fluoride","Sodium Fluoride, 100mg","Sodium Fluoride, 10mg","Sodium polyanethol sulfonate 0.35% in 0.85% sodium chloride","Sodium/Na  Heparin","Sodium/Na EDTA","SPS(this should be spelled out if not universally understood)","Stuart transport medium","Thrombin","Thrombin NIH; soybean trypsin inhibitor (Fibrin Degradation Products)","Thymol","Thyoglycollate broth","Toluene","Ureaplasma transport medium","Viral Transport medium"};
						validVersionDescriptions[HL7Version.v251] = new string[]{"10% Formalin","3.2%  Citrate","3.8% Citrate","6N HCL","ACD Solution A","ACD Solution B","Acetic Acid","Amies transport medium","Ammonium heparin","Bacterial Transport medium","Borate Boric Acid","Bouin's solution","Buffered 10% formalin","Buffered Citrate (Westergren Sedimentation Rate)","Buffered skim milk","Carson's Modified 10% formalin","Cary Blair Medium","Chlamydia transport medium","CTAD (this should be spelled out if not universally understood)","Enteric bacteria transport medium","Enteric plus","Jones Kendrick Medium","Karnovsky's fixative","Lithium iodoacetate","Lithium/Li  Heparin","M4","M4-RT","M5","Michel's transport medium","MMD transport medium","Nitric Acid","None","Pages's Saline","Phenol","Potassium Oxalate","Potassium/K EDTA","Potassium/K EDTA 15%","Potassium/K EDTA 7.5%","PVA (polyvinylalcohol)","Reagan Lowe Medium","Serum Separator Tube (Polymer Gel)","Siliceous earth, 12 mg","Sodium Fluoride","Sodium Fluoride, 100mg","Sodium Fluoride, 10mg","Sodium polyanethol sulfonate 0.35% in 0.85% sodium chloride","Sodium/Na  Heparin","Sodium/Na EDTA","SPS(this should be spelled out if not universally understood)","Stuart transport medium","Thrombin","Thrombin NIH; soybean trypsin inhibitor (Fibrin Degradation Products)","Thymol","Thyoglycollate broth","Toluene","Ureaplasma transport medium","Viral Transport medium"};
						validVersionDescriptions[HL7Version.v26] = new string[]{"10% Formalin","3.2%  Citrate","3.8% Citrate","6N HCL","ACD Solution A","ACD Solution B","Acetic Acid","Amies transport medium","Ammonium heparin","Bacterial Transport medium","Borate Boric Acid","Bouin's solution","Buffered 10% formalin","Buffered Citrate (Westergren Sedimentation Rate)","Buffered skim milk","Carson's Modified 10% formalin","Cary Blair Medium","Chlamydia transport medium","CTAD (this should be spelled out if not universally understood)","Enteric bacteria transport medium","Enteric plus","Jones Kendrick Medium","Karnovsky's fixative","Lithium iodoacetate","Lithium/Li  Heparin","M4","M4-RT","M5","Michel's transport medium","MMD transport medium","Nitric Acid","None","Pages's Saline","Phenol","Potassium Oxalate","Potassium/K EDTA","Potassium/K EDTA 15%","Potassium/K EDTA 7.5%","PVA (polyvinylalcohol)","Reagan Lowe Medium","Serum Separator Tube (Polymer Gel)","Siliceous earth, 12 mg","Sodium Fluoride","Sodium Fluoride, 100mg","Sodium Fluoride, 10mg","Sodium polyanethol sulfonate 0.35% in 0.85% sodium chloride","Sodium/Na  Heparin","Sodium/Na EDTA","SPS(this should be spelled out if not universally understood)","Stuart transport medium","Thrombin","Thrombin NIH; soybean trypsin inhibitor (Fibrin Degradation Products)","Thymol","Thyoglycollate broth","Toluene","Ureaplasma transport medium","Viral Transport medium"};
						validVersionDescriptions[HL7Version.v27] = new string[]{"10% Formalin","3.2%  Citrate","3.8% Citrate","6N HCL","ACD Solution A","ACD Solution B","Acetic Acid","Amies transport medium","Ammonium heparin","Bacterial Transport medium","Borate Boric Acid","Bouin's solution","Buffered 10% formalin","Buffered Citrate (Westergren Sedimentation Rate)","Buffered skim milk","Carson's Modified 10% formalin","Cary Blair Medium","Chlamydia transport medium","CTAD (this should be spelled out if not universally understood)","Enteric bacteria transport medium","Enteric plus","Jones Kendrick Medium","Karnovsky's fixative","Lithium iodoacetate","Lithium/Li  Heparin","M4","M4-RT","M5","Michel's transport medium","MMD transport medium","Nitric Acid","None","Pages's Saline","Phenol","Potassium Oxalate","Potassium/K EDTA","Potassium/K EDTA 15%","Potassium/K EDTA 7.5%","PVA (polyvinylalcohol)","Reagan Lowe Medium","Serum Separator Tube (Polymer Gel)","Siliceous earth, 12 mg","Sodium Fluoride","Sodium Fluoride, 100mg","Sodium Fluoride, 10mg","Sodium polyanethol sulfonate 0.35% in 0.85% sodium chloride","Sodium/Na  Heparin","Sodium/Na EDTA","SPS(this should be spelled out if not universally understood)","Stuart transport medium","Thrombin","Thrombin NIH; soybean trypsin inhibitor (Fibrin Degradation Products)","Thymol","Thyoglycollate broth","Toluene","Ureaplasma transport medium","Viral Transport medium"};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
